<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        function counter() {
            for (; ;) {
                var operational = prompt(`请输入你要进行的运算:\n1.加法\n2.减法\n3.除法\n4.乘法\n5.取余`);
                if (operational > 5) {
                    alert(`请输入正确的序号！！！`);
                    continue;
                }
                var num1 = +prompt(`请输入第一个数！`);
                var num2 = +prompt(`请输入第二个数！`);
                if (operational == '1') {
                    alert( num1 + num2);
                }
                else if (operational == '2') {
                    alert(num1 - num2);
                }
                else if (operational == '3') {
                    alert(num1 * num2);
                }
                else if (operational == '4') {
                    alert(num1 / num2);
                }
                else if (operational == '5') {
                    alert(num1 % num2);
                }
            }
        }
        counter();
    </script>
</head>

<body>

</body>

</html>